﻿<UserControl x:Class="Microsoft.ALMRangers.Samples.MyHistory.ProjectsAndSolutionsSectionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mvvm="clr-namespace:Microsoft.TeamFoundation.MVVM;assembly=Microsoft.TeamFoundation.Controls"
             mc:Ignorable="d" d:DesignWidth="513.6" Height="248.8"
              DataContext="{Binding RelativeSource={RelativeSource Self}}">
    <UserControl.Resources>
         <ResourceDictionary Source="../../../Resources/ResourceDictionary.xaml" />
    </UserControl.Resources>
    <Grid Margin="6,6,6,6">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <ListView x:Name="ListViewMru" Grid.Row="0" ItemsSource="{Binding Path=mruList}" BorderThickness="0"
                  SelectionMode="Single" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                  mvvm:FrameworkElementBehaviors.IgnoreMouseWheel="True" 
                  MouseDoubleClick="ListViewMru_MouseDoubleClick"  KeyDown="ListViewMru_KeyDown">
            <ListView.View>
                <GridView>
                    <GridView.ColumnHeaderContainerStyle>
                        <Style>
                            <Setter Property="FrameworkElement.Visibility" Value="Collapsed"/>
                        </Style>
                    </GridView.ColumnHeaderContainerStyle>
                    <GridViewColumn>
                        <GridViewColumnHeader Content="Changeset"/>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=ProjectName}"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
            <ListView.ItemContainerStyle>
                <Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListViewItem}}">
                    <Setter Property="ToolTip">
                        <Setter.Value>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>


                                <TextBlock Grid.Row="0" Grid.Column="0" Margin="0,0,6,3" Text="Path:" FontWeight="Bold"/>
                                <TextBlock Grid.Row="0" Grid.Column="1" Margin="0,0,0,3" Text="{Binding Path=ProjectPath}"/>
              </Grid>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ListView.ItemContainerStyle>
        </ListView>
    </Grid>
</UserControl>
